import axios from 'axios'

const api_url = 'http://localhost:3000/'

function actionURL(action) {
    return api_url + action;
}

const http = axios;

//get请求
// function get(action) {
//     return async params => http.get(actionURL(action), params)
// }

//post请求
async function post(action, params) {
    let res = await http.post(actionURL(action), params);
    return await res.data;
}

// 接口
export const login = async (params) => post('account/login', params);